<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>公司管理</title>
</head>
<body class="layui-layout-body">
<div class="layui-body">
        <div class="body_right">
            <h4 class="nav_title">公司管理
            <a href="/admin/company/addInfo.htm" class="add_btn">添加</a>
            </h4>
            
             <form class="layui-form" action="/admin/company/list.htm">
             <div class="layui-row">
            		<div class="layui-form-item">
	            		<div class="layui-inline">
	                        <label class="layui-form-label ">公司名称</label>
	                        <div class="layui-input-inline" style="width:300px">
	                            <input type="text" name="companyName" value="${query.companyName}"  autocomplete="off" class="layui-input"  placeholder="请输入公司名称">
	                        </div>
	                    </div>
	                    <div class="layui-inline">
	                        <label class="layui-form-label">法人姓名</label>
	                        <div class="layui-input-inline">
	                            <input type="text" name="legalPerson" value="${query.legalPerson}"  autocomplete="off" class="layui-input" placeholder="法人姓名">
	                        </div>
	                    </div>
                    
            	    </div>
             </div>
             
             <div class="layui-row">
            		<div class="layui-form-item">
            			<div class="layui-inline">
                        <label class="layui-form-label">管理员姓名</label>
                        <div class="layui-input-inline">
                            <input type="text" name="name" value="${query.name}" autocomplete="off" class="layui-input" placeholder="管理员姓名">
                        </div>
                    </div>
            		
            			<div class="layui-inline">
                        <label class="layui-form-label">创建时间</label>
                        <div class="layui-input-inline" style="width:100px">
                            <input type="text" class="layui-input" name="startTime" autocomplete="off" id="startTime" value="<#if query.startTime??>${query.startTime?string('yyyy-MM-dd')}</#if>" placeholder="开始时间">
                        </div>
                       <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline" style="width:100px">
                            <input type="text" class="layui-input" name="endTime" autocomplete="off" id="endTime" value="<#if query.endTime??>${query.endTime?string('yyyy-MM-dd')}</#if>" placeholder="结束时间">
                        </div>
                    </div>
                    
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <button class="layui-btn" lay-submit=""><i class="layui-icon"></i>搜索</button>
                        </div>
                    </div>
            	    </div>
             </div>
	         </form>  
	       
            
           
            <table class="layui-table mytable" lay-even="" lay-skin="nob">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>公司名称</th>
                    <th>管理员</th>
                    <th>创建时间</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                	    <#list pm.datas as item>
                    <tr>
                        <td>${item.companyId}</td>
                        <td>${item.companyName}</td>
                        <td>
                        		<#if item.userLoginId??>
                        		<#if item.person??>
                        		${item.person.name}/${item.userLoginId}
                        		</#if>
                        		</#if>
                        </td>
                        <td>${item.createTime?string('yyyy-MM-dd HH:mm:ss')}</td>
                        <td>
                        		<#if item.companyStatus == 'CREATED'>
                        			<span class="layui-bg-red">待完善</span>
                        		</#if>
                        		<#if item.companyStatus == 'PENDING'>
                        			<span class="layui-bg-orange">待审核</span>
                        		</#if>
                        		<#if item.companyStatus == 'ACTIVITY'>
                        			<span class="layui-bg-green">正常</span>
                        		</#if>
                        </td>
                        <td>
                        		<#if item.companyStatus == 'CREATED'>
                        			<a href="/admin/company/addAccount.htm?companyId=${item.companyId}">完善信息</a>
                        		</#if>
                        		<#if item.companyStatus == 'PENDING'>
                        			<a href="">审核</a>
                        		</#if>
                        		<#if item.companyStatus == 'ACTIVITY'>
                        			<a href="/admin/company/info.htm?companyId=${item.companyId}">查看</a>
                        		</#if>
                        </td>
                    </tr>
                    </#list>
                    
                </tbody>
            </table>
            <@p.page pm=pm></@p.page>
        </div>
     </div>
<script>
     	//全局定义一次, 加载formSelects
	    layui.config({
	        base: '/asset/plugin/formSelects/dist/' //此处路径请自行处理, 可以使用绝对路径
	    }).extend({
	        formSelects: 'formSelects-v4'
	    });
     
        layui.use(['form','layer','laydate'], function(){
            $ = layui.jquery;
          var form = layui.form ,layer = layui.layer,laydate = layui.laydate;
          
          laydate.render({
		    elem: '#startTime' //指定元素
		  });
          
          laydate.render({
		    elem: '#endTime' //指定元素
		  });
          
          
        });
    </script>
     
</body>
</html>